#define _GNU_SOURCE
#include<stdio.h>
#include<stdarg.h>
#include<stdlib.h>


#define LOG(fmt,...) printf("%s-%d\n" fmt,__FILE__,__LINE__,##__VA_ARGS__);


void printNum(int count,...)
{
  va_list ap;
  va_start(ap,count);
  for(int i=0;i<count;i++)
  {
    int num=va_arg(ap,int);
    printf("param[%d]:%d\n",i,num);
  }
  va_end(ap);
}
void myprintf(const char* fmt,...)
{
    va_list ap;
    va_start(ap,fmt);
    char *res;
    int ret=vasprintf(&res,fmt,ap);
    if(ret!=-1)
    {
        printf("%s",res);
        free(res);
    }
    va_end(ap);
}
int main()
{
  LOG("比特就业课");
  printNum(2,666,777);
  printNum(5,1,2,3,4,5);
  myprintf("%s-%d\n","比特就业课",666);
  myprintf("比特就业课");
  return 0;
}